package com.lb.shopguide.http.method;

import com.lb.baselib.http.ApiMethodBase;
import com.lb.shopguide.http.ApiClient;
import com.trello.rxlifecycle2.LifecycleProvider;

import io.reactivex.Observer;
import okhttp3.RequestBody;
import retrofit2.http.Body;

public class ApiMethodGuide extends ApiMethodBase {

    public static void getGoodsTypesByShop(Observer observer, String storeCode, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.getGoodsTypesByShop(storeCode).compose(provider.bindUntilEvent(event)), observer);
    }

    public static void getGoodsListByCondition(Observer observer, String storeCode, String typeCode, String productName, int pageNum, int pageSize, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.getGoodsListByCondition(storeCode, typeCode, productName, pageNum, pageSize).compose(provider.bindUntilEvent(event)), observer);
    }

    public static void getGoodsDetail(Observer observer, String productCode, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.getGoodsDetail(productCode).compose(provider.bindUntilEvent(event)), observer);
    }

    public static void getMemberList(Observer observer, String storeCode, String condition, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.getMemberList(storeCode, condition).compose(provider.bindUntilEvent(event)), observer);
    }

    public static void getGuideMemberList(Observer observer, String condition, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.getGuideMemberList(condition).compose(provider.bindUntilEvent(event)), observer);
    }

    public static void getFansList(Observer observer, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.getFansList().compose(provider.bindUntilEvent(event)), observer);
    }

    public static void getCouponList(Observer observer, String memberCode, String type, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.getCouponList(memberCode, type).compose(provider.bindUntilEvent(event)), observer);
    }

    public static void getMijiInfo(Observer observer, String mijiCode, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.getMijiInfo(mijiCode).compose(provider.bindUntilEvent(event)), observer);
    }

    public static void getMijiListByTutorCode(Observer observer, String tutorCode, String staffCode, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.getMijiListByTutorCode(tutorCode, staffCode).compose(provider.bindUntilEvent(event)), observer);
    }

    public static void getTutorList(Observer observer, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.getTutorList().compose(provider.bindUntilEvent(event)), observer);
    }

    public static void praiseMiji(Observer observer, String storeCode, String mijiCode, LifecycleProvider provider, Object event) {
        if (provider != null) {
            ApiSubscribe(ApiClient.guideService.praiseMiji(storeCode, mijiCode).compose(provider.bindUntilEvent(event)), observer);
        } else {
            ApiSubscribe(ApiClient.guideService.praiseMiji(storeCode, mijiCode), observer);
        }
    }

    public static void getMemberOrderList(Observer observer, String accId, int pageNum, int pageSize, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.getMemberOrderList(accId, pageNum, pageSize).compose(provider.bindUntilEvent(event)), observer);
    }

    public static void getOrderList(Observer observer, String staffCode, int orderType, int pageNum, int pageSize, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.getOrderList(staffCode, orderType, pageNum, pageSize).compose(provider.bindUntilEvent(event)), observer);
    }

    public static void getOrderRecList(Observer observer, int orderStatus, int serviceOrderSymbol, int pageNum, int pageSize, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.getOrderRecList(orderStatus, serviceOrderSymbol, pageNum, pageSize).compose(provider.bindUntilEvent(event)), observer);
    }

    public static void getExpressList(Observer observer, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.getExpressList().compose(provider.bindUntilEvent(event)), observer);
    }

    public static void commitBuyOrder(Observer observer, @Body RequestBody body, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.commitBuyOrder(body).compose(provider.bindUntilEvent(event)), observer);
    }

    public static void collectData(Observer observer, @Body RequestBody body) {
        ApiSubscribe(ApiClient.guideService.collectData(body), observer);
    }

    public static void confirmBuyOrder(Observer observer, @Body RequestBody body, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.confirmBuyOrder(body).compose(provider.bindUntilEvent(event)), observer);
    }

    public static void getOrderDetail(Observer observer, String orderNum, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.getOrderDetail(orderNum).compose(provider.bindUntilEvent(event)), observer);
    }

    public static void changeOrderPayMode(Observer observer, String orderNum, int payMode, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.changeOrderPayMode(orderNum, payMode).compose(provider.bindUntilEvent(event)), observer);
    }

    public static void getShipInfo(Observer observer, String orderNum, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.getShipInfo(orderNum).compose(provider.bindUntilEvent(event)), observer);
    }

    public static void commitSendGoods(Observer observer, @Body RequestBody body, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.commitSendGoods(body).compose(provider.bindUntilEvent(event)), observer);
    }

    public static void payCashConfirm(Observer observer, @Body RequestBody body, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.payCashConfirm(body).compose(provider.bindUntilEvent(event)), observer);
    }

    public static void closeOrder(Observer observer, @Body RequestBody body, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.closeOrder(body).compose(provider.bindUntilEvent(event)), observer);
    }

    public static void payBalance(Observer observer, @Body RequestBody body, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.payBalance(body).compose(provider.bindUntilEvent(event)), observer);
    }

    public static void operateOrder(Observer observer, @Body RequestBody body, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.operateOrder(body).compose(provider.bindUntilEvent(event)), observer);
    }


    public static void refreshQrCode(Observer observer, String orderNum, int payMode, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.refreshQrCode(orderNum, payMode).compose(provider.bindUntilEvent(event)), observer);
    }

    public static void changePrice(Observer observer, @Body RequestBody body, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.changePrice(body).compose(provider.bindUntilEvent(event)), observer);
    }

    public static void confirmOrderPay(Observer observer, @Body RequestBody body, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.confirmOrderPay(body).compose(provider.bindUntilEvent(event)), observer);
    }

    public static void getVerifyNum(Observer observer, String mobileNum, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.getVerifyNum(mobileNum).compose(provider.bindUntilEvent(event)), observer);
    }

    public static void verifyPhone(Observer observer, String mobileNum, String validNum, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.verifyPhone(mobileNum, validNum).compose(provider.bindUntilEvent(event)), observer);
    }

    public static void getStaffInfo(Observer observer, String staffCode, LifecycleProvider provider, Object event) {
        if (provider != null) {
            ApiSubscribe(ApiClient.guideService.getStaffInfo(staffCode).compose(provider.bindUntilEvent(event)), observer);
        } else {
            ApiSubscribe(ApiClient.guideService.getStaffInfo(staffCode), observer);
        }
    }

    public static void getPerformance(Observer observer, String staffCode, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.getPerformance(staffCode).compose(provider.bindUntilEvent(event)), observer);
    }

    public static void getQiniuToken(Observer observer, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.getQiniuToken().compose(provider.bindUntilEvent(event)), observer);
    }

    public static void saveUserInfo(Observer observer, @Body RequestBody body, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.saveUserInfo(body).compose(provider.bindUntilEvent(event)), observer);
    }

    public static void saveAlipayAccountInfo(Observer observer, @Body RequestBody body, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.saveAlipayAccountInfo(body).compose(provider.bindUntilEvent(event)), observer);
    }

    public static void getHomeMessage(Observer observer, String staffCode, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.getHomeMessage(staffCode).compose(provider.bindUntilEvent(event)), observer);
    }

    public static void getAppVersion(Observer observer, String appType, String terminalType) {
        ApiSubscribe(ApiClient.guideService.getAppVersion(appType, terminalType), observer);
    }

    public static void getActivity(Observer observer, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.getActivity().compose(provider.bindUntilEvent(event)), observer);
    }

    public static void getAlipayAccount(Observer observer, LifecycleProvider provider, Object event) {
        if (provider != null) {
            ApiSubscribe(ApiClient.guideService.getAlipayAccount().compose(provider.bindUntilEvent(event)), observer);
        } else {
            ApiSubscribe(ApiClient.guideService.getAlipayAccount(), observer);
        }
    }

    public static void getEarningsDetail(Observer observer, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.getEarningsDetail().compose(provider.bindUntilEvent(event)), observer);
    }

    public static void refreshGuideYXToken(Observer observer, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.refreshGuideYXToken().compose(provider.bindUntilEvent(event)), observer);
    }

    public static void getSalesStatistics(Observer observer, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.getSalesStatistics().compose(provider.bindUntilEvent(event)), observer);
    }

    public static void listProductZone(Observer observer, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.listProductZone().compose(provider.bindUntilEvent(event)), observer);
    }

    public static void listRecommendProductInHome(String zoneCode, Observer observer, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.listRecommendProduct(1, zoneCode).compose(provider.bindUntilEvent(event)), observer);
    }

    public static void listRecommendProductAll(Observer observer, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.listRecommendProduct(2, "").compose(provider.bindUntilEvent(event)), observer);
    }

    public static void listMaterialProductInHome(Observer observer, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.listMaterialProduct(3).compose(provider.bindUntilEvent(event)), observer);
    }

    public static void listMaterialProduct(Observer observer, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.listMaterialProduct(4).compose(provider.bindUntilEvent(event)), observer);
    }

    public static void getAdBanner(int position, Observer observer, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.getAdBanner(position).compose(provider.bindUntilEvent(event)), observer);
    }

    public static void getProductDetail(String productCode, Observer observer, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.getProductDetail(productCode).compose(provider.bindUntilEvent(event)), observer);
    }

    public static void listEarnProfitStaff(String productCode, Observer observer, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.listEarnProfitStaff(productCode).compose(provider.bindUntilEvent(event)), observer);
    }

    public static void getMaterialUrl(Observer observer, LifecycleProvider provider, Object event) {
        ApiSubscribe(ApiClient.guideService.getMaterialUrl().compose(provider.bindUntilEvent(event)), observer);
    }

    public static void getAdLoading(Observer observer) {
        ApiSubscribe(ApiClient.guideService.getAdLoading(), observer);
    }

    public static void getGoodsPicDetail(String productCode, Observer observer, LifecycleProvider provider, Object event){
        ApiSubscribe(ApiClient.guideService.getGoodsPicDetail(productCode).compose(provider.bindUntilEvent(event)), observer);
    }

    public static void getActivityProgress(Observer observer, LifecycleProvider provider, Object event) {
        if (provider != null) {
            ApiSubscribe(ApiClient.guideService.getActivityProgress().compose(provider.bindUntilEvent(event)), observer);
        } else {
            ApiSubscribe(ApiClient.guideService.getActivityProgress(), observer);
        }
    }

    public static void getIntervalHint(Observer observer, LifecycleProvider provider, Object event) {
        if (provider != null) {
            ApiSubscribe(ApiClient.guideService.getIntervalHint().compose(provider.bindUntilEvent(event)), observer);
        } else {
            ApiSubscribe(ApiClient.guideService.getIntervalHint(), observer);
        }
    }

}
